package cn.longg.config;

import cn.longg.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;

import javax.sql.DataSource;

@Configuration
@ComponentScan("cn.longg.service")
public class SpringService {
    @Bean
    public DataSourceTransactionManager getTM(DataSource dataSource){
        return new DataSourceTransactionManager(dataSource);
    }

    @Bean
    public LoginInterceptor getLoginInterceptor(){
        return new LoginInterceptor();
    }
}
